class MyException(Exception):
    def __init__(self, name):
        self.name = name

    @property
    def msg(self):
        return "名字重复 ：%s" % self.name


name = "李四"
try:
    if name == "李四":
        raise MyException(name)
except MyException as e:
    print(e.msg)

try:
    a = 1 / 0
except Exception:
    print("运算错误")

